<div class="arrange-tasks main">
  <div class="container-header">
    安排任务
  </div>
  <div class="arrange-tasks-content-outer">
    <form class="clear" name="addForm" novalidate>
      <div class="pa-form-control">
        <label><b>*</b>任务名称:</label>
        <input type="text" name="taskDescription" required
          ng-model="arrangeTasks.task.taskDescription">
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.taskDescription.$dirty) && addForm.taskDescription.$error.required">
          必填
        </span>
      </div>
      <div class="pa-form-control">
        <label><b>*</b>考核项目:</label>
        <div class="add-item">
          <div ng-click="arrangeTasks.openTree()">
            <img src="../../../assets/images/add-item-icon.png">
            <span>新增考核项</span>
          </div>
          <!-- ztree nodes -->
          <div class="tree-container shadowbox"
            ng-class="{active: arrangeTasks.treeActive}"
            ng-show="arrangeTasks.treeActive">
            <div class="tree-header">
              <span>考核项分类</span>
              <i class="fa fa-times"
                ng-click="arrangeTasks.closeTree()"></i>
            </div>
            <ul class="ztree" id="tree"></ul>
          </div>
        </div>
      </div>
      <div class="pa-form-control">
        <label>内业:</label>
        <div class="add-item page-item">
          <a class="pa-item-btn"
            ng-repeat="item in arrangeTasks.innerCheckItemList track by item.id"
            ng-click="arrangeTasks.openItemDetail(item)"
            ng-class="{'item-btn-important': item.active}">
            {{item.name}}
          </a>
        </div>
      </div>
      <div class="pa-form-control">
        <label>外页:</label>
        <div class="add-item page-item">
          <a class="pa-item-btn"
            ng-repeat="item in arrangeTasks.outerCheckItemList"
            ng-click="arrangeTasks.openItemDetail(item)"
            ng-class="{active: item.active}">
            {{item.name}}
          </a>
        </div>
      </div>
      <div class="pa-form-control">
        <label><b>*</b>实施标段:</label>
        <select name="bidName" required 
          ng-model="arrangeTasks.task.carryOutBidId"
          style="width:188px;">
          <option value=""></option>
          <option
            ng-repeat ="item in arrangeTasks.sectionList"
            value="{{item.tenderId}}">{{item.tenderName}}</option>
        </select>
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.bidName.$dirty) && addForm.bidName.$error.required">
          必填
        </span>
      </div>
      <div class="pa-form-control">
        <label><b>*</b>实施单位:</label>
        <select name="orgUnitName" required style="width: 188px;"
          ng-model="arrangeTasks.task.carryOutOrgId">
          <option
            ng-repeat="item in arrangeTasks.units"
            value="{{item.orgId}}">{{item.orgName}}</option>
        </select>
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.orgUnitName.$dirty) && addForm.orgUnitName.$error.required">
          必填
        </span>
      </div>
      <div class="pa-form-control">
        <label><b>*</b>起始时间:</label>
        <input type="text" ng-datepicker
          name="startDate" required
          ng-model="arrangeTasks.task.startDate">
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.startDate.$dirty) && addForm.startDate.$error.required">
          必填
        </span>
      </div>
      <div class="pa-form-control">
        <label><b>*</b>结束时间:</label>
        <input type="text" ng-datepicker name="endDate" required 
          ng-model="arrangeTasks.task.endDate">
        <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.endDate.$dirty) && addForm.endDate.$error.required">
          必填
        </span> 
      </div>
      <div class="pa-form-control">
        <label><b>*</b>制定单位:</label>
        <input type="text" name="madeOrg" required 
          ng-model="arrangeTasks.task.madeOrg">
       <span class="error-tip"
          ng-show="(addForm.$submitted || addForm.madeOrg.$dirty) && addForm.madeOrg.$error.required">
          必填
        </span> 
      </div>
      <!-- <div class="pa-form-control">
        <label>制定时间:</label>
        <input name="name" id="name" type="text" ng-datepicker>
      </div> -->
      <div class="btn-outer">
        <a class="pa-btn"
          authorization-btn="api/securityActivities/specialCheck/addTask"
          ng-click="arrangeTasks.save(addForm)">
          <i class="fa fa-search"></i>
          <span class="ml5">保存</span>
        </a>
        <a class="pa-btn reset-btn">
          <i class="fa fa-repeat"></i>
          <span class="ml5">重置</span>
        </a>
      </div>     
    </form>
  </div>


  <!-- 弹窗 -->
  <script type="text/ng-template" id="itemDetailDialog">
    <div class="item-detail-dialog">
        <div class="item-detail-dialog-header">
          <div class="title-txt">
            <span>{{item.checkCategoryName}}</span>
          </div>
        </div>
        <div class="item-detail-dialog-content">
          <div class="row-item">
            <div class="fixed-left-label">标准分：</div>
            <div class="right-value">
              <div class="line">
                {{item.standardScore}}分
              </div>
            </div>
          </div>
          <div class="row-item">
            <div class="fixed-left-label">考核内容：</div>
            <div class="right-value">
              <div class="line">
                {{item.checkContent}}
              </div>
            </div>
          </div>
          <div class="row-item">
            <div class="fixed-left-label">考核方法：</div>
            <div class="right-value">
              <div class="line">
                {{item.checkMethod}}
              </div>
            </div>
          </div>
          <div class="table-outer">
            <table class="pa-table">
              <thead>
                <th style="width: 54%">扣分原因</th>
                <th>扣分描述</th>
                <th>分值</th>
              </thead>
              <tbody>
                <tr  ng-repeat="item in item.safeCheckProjectList">
                  <td>{{item.checkProjectDescribe}}</td>
                  <td>{{arrangeTasks.getPenaltyPointsType(item.kouFenType)}}</td>
                  <td>{{arrangeTasks.getPenaltyPointsValue(item)}}</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
  </script>
</div>